<extend name="./base" />
<block name="title">机构列表</block>
<block name="body">
    <h1>
        机构列表
    </h1>
    <form method="post">
        <dl>
        <dt>搜索条件</dt>
        <dd>
            机构名称：<input type="text" name="Username" value="{$form.Username}">
        </dd>
        <dd>
            机构地点：<input type="text" name="address" value="{$form.address}">
        </dd>
        <dd>
            <button type="submit">搜索</button>
        </dd>
    </dl>
    </form> 
    <table class="table table-bordered">
            <thead>
                <tr>
                    <th>机构名称</th>
                    <th>地点</th>
                    <th>电话</th>
                    <th>详情</th>
                </tr>
            </thead>
            <tbody>
                <?php
                    foreach($department as $key => $val){
                        ?>
                        <tr>
                            <th><?php echo $val['username'] ?></th>
                            <th><?php echo $val['address'] ?></th>
                            <th><?php echo $val['phone'] ?></th>
                            <th><a href='/Bailey/index.php/Home/Index/departmentDetail/user_id/<?php echo $val["user_id"] ?>'>详情</a></th>
                        </tr>   
                        <?php
                    }
                ?>
    </tbody>
    </table>
</block>